<?php
/**
 * PC 端 头部公共控制器
 * headercontroller.php
 * 
 * Create on 2015-03-30
 * Create by yuebin
 */
namespace haibao\cms\business\control\pc;

class HeaderController extends \haibao\cms\business\control\Base{
	
	const STYLE_STATIC_URL = 'http://static.localhaibao.cn:81/static/html/';
	public function __construct($updateTime = null,$controlId,$isPublish){
		parent::__construct($updateTime,$controlId,$isPublish);
	}
	
	
	/**
	 * 获取模版内容
	 * @param : String $content
	 */
	public function displayTemplateHtml(){

		$controlData = $this->getParameter(self::$CONTROL_DATA);
		$content = $this->getParameter(self::$CONTROL_CONTENT);
		$path = $this->generateHtmlPath(__CLASS__);
		$parameters = array();
		if($controlData['auto']){
			
			$temp = array();
			foreach($controlData['auto'] as $data){
				$parameterValue = json_decode($data['ParameterValue']);
				array_push($parameters,$parameterValue);
			}
		}
		if($controlData['manual']){
			$this->setParameter('width',$controlData['manual']['width']);
		}
		$this->assign('parameters', $parameters);
		
		$this->assign('staticUrl',self::STYLE_STATIC_URL);
		$this->generateHtml($path,$content);
		return $this->getHtml($path);
	}
}